import 'package:flutter/material.dart';
import 'package:flutter_cate/ui/pages/home/home_app_bar.dart';
import 'initialize_item.dart';
import 'package:flutter_cate/ui/pages/home/home_drawer.dart';

class AMMainScreen extends StatefulWidget {

  static const String routeName = "/";

  @override
  _AMMainScreenState createState() => _AMMainScreenState();
}

class _AMMainScreenState extends State<AMMainScreen> {

  int _currentIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      drawer: AMHomeDrawer(),
      body: IndexedStack(
        index: _currentIndex,
        children: pages,
      ),
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: _currentIndex,
        selectedFontSize: 14,
        unselectedFontSize: 14,
        items: items,
        onTap: (index){
          setState(() {
            _currentIndex = index;
          });
        },
      ),
    );
  }
}
